package cn.matezk.iot;

import com.sun.jna.Library;
import com.sun.jna.Native;

public interface TscLibDll extends Library {
    TscLibDll INSTANCE = Native.load("TSCLIB", TscLibDll.class);
    int about();
    int openport(String pirnterName);
    int closeport();
    int sendcommand(String printerCommand);
    int sendBinaryData(byte[] printerCommand, int CommandLength);
    int setup(String width, String height, String speed, String density, String sensor, String vertical, String offset);
    int downloadpcx(String filename, String image_name);
    int barcode(String x, String y, String type, String height, String readable, String rotation, String narrow, String wide, String code);
    int printerfont(String x, String y, String fonttype, String rotation, String xmul, String ymul, String text);
    int clearbuffer();
    int printlabel(String set, String copy);
    int windowsfont(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, String content);
    int windowsfontUnicode(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, byte[] content);
    int windowsfontUnicodeLengh(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName, byte[] content, int length);
    byte usbportqueryprinter();

    // 纠错等级
    interface EccLevel {
        String L_PERCENT_7  = "L";
        String M_PERCENT_15 = "M";
        String Q_PERCENT_25 = "Q";
        String H_PERCENT_30 = "H";
    }

    // cell Width
    interface  CellWidth {
        int W1 = 1;
        int W2 = 2;
        int W3 = 3;
        int W4 = 4;
        int W5 = 5;
        int W6 = 6;
        int W7 = 7;
        int W8 = 8;
        int W9 = 9;
        int W10 = 10;
    }

    // 模式
    interface Mode {
        // 自动编码
        String AUTOMATIC = "A";
        // 手动编码
        String Manual = "M";
    }

    // 旋转
    interface Rotation {
        int ANGLE_0 = 0;
        int ANGLE_90 = 90;
        int ANGLE_180 = 180;
        int ANGLE_270 = 270;
    }

    // 条码对齐位置
    interface Justification {
        String J1 = "J1";
        String J2 = "J2";
        String J3 = "J3";
        String J4 = "J4";
        String J5 = "J5";
        String J6 = "J6";
        String J7 = "J7";
        String J8 = "J8";
        String J9 = "J9";
    }

    // 版本
    interface Model {
        // 默认原始版本
        String DEFAULT = "M1";
        // 扩大版本(大部分的智能手机支持此版本)
        String EXT = "M2";
    }

    interface Mask {
        String S0 = "S0";
        String S1 = "S1";
        String S2 = "S2";
        String S3 = "S3";
        String S4 = "S4";
        String S5 = "S5";
        String S6 = "S6";
        String S7 = "S7"; // 默认
        String S8 = "S8";
    }
}
